var vm;
var cusId=sessionStorage.getItem("cusId");

$(function () {
    vm = new Vue({
        el: '#rrapp',
        data: {
            tabsShow:true,
            clicktag:0,//防重复提交
            query:{cusId:cusId,startDate:'',endDate:'',type:'',status:'',qudao:''}
        },
        methods: {
            query01:function () {
                vm.reload();
            },
            //重新加载列表
            reload: function () {
                $("#jqGrid").setGridParam({
                    postData: {
                        cusId:vm.query.cusId,
                        startDate : vm.query.startDate,
                        endDate : vm.query.endDate,
                        type : vm.query.type,
                        qudao:vm.query.qudao,
                        status :vm.query.status
                    },
                    page:1,
                }).trigger("reloadGrid");
            },
        }
    });


    $("#jqGrid").jqGrid({
        url: '../homePage/querylistRecharge',
        datatype: "json",
        colModel: [
            {label: 'id', name: 'id', width: 30,key: true,hidden:true },
            {label: '充值时间', name: 'creTime', width: 30},
            {label: '银行卡', name: 'bankCNo', width: 30},
            {label: '所属银行', name: 'bankName', width: 20 },
            {label: '订单号', name: 'orderNo', width: 20 },
            {label: '充值类型', name: 'payType', width: 30,formatter:payTypeFormat},
            {label: '充值渠道', name: 'qudao', width: 30,formatter:qudao},
            {label: '充值金额（元）', name: 'amount', width: 20},
            {label: '状态', name: 'status', width: 20,formatter:rechangerStatus},
            {label: '失败原因', name: 'msg', width: 20}
        ],
        viewrecords: true,
        height: 500,
        rowNum: 10,
        rowList: [10, 30, 50],
        rownumbers: true,
        rownumWidth: 55,
        autowidth: true,
        multiselect: false,
        pager: "#jqGridPager",
        postData: {
            cusId:vm.query.cusId,
            startDate : vm.query.startDate,
            endDate : vm.query.endDate,
            type : vm.query.type,
            qudao:vm.query.qudao,
            status :vm.query.status
        },
        jsonReader: {
            root: "page.list",
            page: "page.currPage",
            total: "page.totalPage",
            records: "page.totalCount"
        },
        prmNames: {
            page: "page",
            rows: "limit",
            order: "order"
        },
        gridComplete: function () {
            //隐藏grid底部滚动条
            $("#jqGrid").closest(".ui-jqGrid-bdiv").css({"overflow-x": "hidden"});
            $("#jqGrid").jqGrid("setGridWidth",$(window).width());
        }
    });



});
